<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>后台管理系统-二级分类</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="assets/bootstrap-validator/css/bootstrapValidator.min.css" />
    <link rel="stylesheet" href="assets/nprogress/nprogress.css" />
    <link rel="stylesheet" href="css/admin.css" />
    <style>
    .fileupload {
        position: relative;
    }
    
    .fileupload [type="file"] {
        width: 82px;
        height: 34px;
        position: absolute;
        opacity: 0;
    }
    </style>
</head>

<body>
    <!--侧边栏-->
    <aside class="ad_aside">
        <!--商标-->
        <div class="brand"><a href="index.html">ITCAST</a></div>
        <!--用户-->
        <div class="user">
            <img src="images/default.png" alt="" />
            <span>超级管理员</span>
        </div>
        <!--菜单-->
        <div class="menu">
            <ul>
                <li><a href="userManage.html"><span class="glyphicon glyphicon-user"></span> 用户管理</a></li>
                <li class="now">
                    <a href="javascript:;"><span class="glyphicon glyphicon-list"></span> 分类管理</a>
                    <div class="child">
                        <a href="categoryFirst.html">一级分类</a>
                        <a class="now" href="categorySecond.html">二级分类</a>
                    </div>
                </li>
                <li><a href="productManage.html"><span class="glyphicon glyphicon-tags"></span> 商品管理</a></li>
            </ul>
        </div>
    </aside>
    <!--内容-->
    <section class="ad_section">
        <!-- 顶部导航 -->
        <nav class="ad_nav">
            <a data-menu href="javascript:;"><span class="glyphicon glyphicon-align-justify"></span></a>
            <a data-logout href="javascript:;"><span class="glyphicon glyphicon-log-out"></span></a>
        </nav>
        <div class="container-fluid">
            <!-- 路径导航 -->
            <ol class="breadcrumb">
                <li><a href="#">管理系统</a></li>
                <li class="active">分类管理</li>
                <li class="active">二级分类(品牌)</li>
            </ol>
            <div class="ad_content">
                <button id="addBtn" class="btn btn-default mb_15" data-toggle="modal" data-target="#addModal">添加分类</button>
                <table class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th width="10%">序号</th>
                            <th width="30%">一级分类名称</th>
                            <th width="30%">二级分类名称(品牌)</th>
                            <th width="30%">二级分类LOGO</th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <div class="page">
                    <ul class="pagination">
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <!-- 模态框 -->
    <div class="modal fade" id="addModal">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" data-toggle="modal" data-target=".modal">添加分类</h4>
                </div>
                <div class="modal-body">
                    <form id="form" action="#">
                        <div class="form-group">
                            <label>一级分类：</label>
                            <div class="btn-group">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                    <span class="categoryName">请选择</span> <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                </ul>
                            </div>
                            <!--表单序列化只能拿到表单元素 -->
                            <input type="hidden" name="categoryId">
                        </div>
                        <div class="form-group">
                            <label for="secondCategory">二级分类(品牌)</label>
                            <input type="text" class="form-control" id="secondCategory" placeholder="请输入二级分类名称" name="brandName">
                        </div>
                        <div class="form-group">
                            <input type="hidden" name="brandLogo">
                            <div class="fileupload">
                                <input type="file" name="pic1" class="btn btn-default">
                                <a href="javascript:;" class="btn btn-default">上传图片</a>
                            </div>
                        </div>
                        <div class="form-group"><img width="100" height="100" src="images/none.png" alt="" id="uploadImg" ></div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary" form="form">确认</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 模板引擎 -->
    <script type="text/template" id="template">
        <% for(var i=0;i<rows.length;i++){ %>
            <tr>
                <td>
                    <%= (page-1)*size+i+1 %>
                </td>
                <td>
                    <%= rows[i].categoryName %>
                </td>
                <td>
                    <%= rows[i].brandName %>
                </td>
                <td><img width="50" height="50" src="<%=rows[i].brandLogo%>" alt=""></td>
            </tr>
            <% } %>
    </script>
    <!-- 模板引擎 -->
    <script type="text/template" id="firstCategoryTemplate">
        <% for(var i=0;i<rows.length;i++){ %>
            <li>
                <a data-id="<%= rows[i].id %>" href="#">
                    <%= rows[i].categoryName %>
                </a>
            </li>
            <% } %>
    </script>
    <script src="assets/jquery/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <script src="assets/nprogress/nprogress.js"></script>
    <script src="assets/artTemplate/template-native.js"></script>
    <script src="assets/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <script src="assets/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="assets/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="assets/jquery-UI/jquery-ui.min.js"></script>
    <script src="js/admin.js"></script>
    <script src="js/categorySecond.js"></script>
</body>

</html>
